<%@ page language="java" import="java.util.*,com.entity.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
if(request.getAttribute("result")!=null){
	if(request.getAttribute("result").equals("ok")){
	%>
		<script>alert("修改成功");</script>
	<%
	}
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<link rel="stylesheet" type="text/css" href="css/style.css">
    <script src="/inc/js/ccorrect_btn.js"></script>
    <title>修改密码</title>
    
    <script type="text/javascript">
       function checkpwd()
       {
          var dlyhmm = form1.dlyhmm.value;
          var oldpwd = form1.pass0.value;
          if(dlyhmm!=oldpwd)
          {
             alert("旧密码不正确，请重新输入");
             form1.pass0.focus();
             return false;
          }
          else
          {
              style1.style.display="none";
          }
		  
		  var newpwd = form1.pass1.value;
		   
         var newpwd2 = form1.pass2.value;
         if(newpwd2!=newpwd)
         {
           alert("两次输入的密码不一致");
		   return false;
         }
         else
         {
            style2.style.display="none";
         }
		  
       }
     
    </script>
    
  </head>
  
  <body>
   <table class="TableTop" width="60%" align="center">
   <tbody><tr>
      <td class="left"></td>
      <td class="center subject">
         修改密码</td>
      <td class="right"></td>
   </tr>
</tbody></table>

<form method="post" action="dlyh.do?state=saveyhpwd" name="form1" onSubmit=" return checkpwd();" >
   <% Dlyh dlyh =(Dlyh) request.getSession().getAttribute("dlyh"); %>
  <table class="TableBlock" width="60%" align="center">
   <tr class="Big">
    <input type="hidden" value="<%=dlyh.getId() %>" name="yhid" id="yhid">
    <input type="hidden" value="<%=dlyh.getYhjb() %>" name="yhjb" id="yhjb" />
    <input type="hidden" value="<%=dlyh.getZd().getId() %>" name ="bmbh" id="bmbh"/>
    <input type="hidden" value=<%=dlyh.getSfzz() %> name="sfzz" id="sfzz"/>
	<td class="TableData" width="120">用户名：</td>
	<td class="TableData"><%=dlyh.getDlyhmc() %>
   </tr>
   <tr>
    <input type = "hidden" name="dlyhmm" id="dlyhmm" value="<%=dlyh.getDlyhmm() %>">
	<td class="TableData" >原密码：</td>
	<td class="TableData" >
	  <input type="password" name="pass0"  id="pass0" class="BigInput" size="20">
	  <div id="style1" ></div>
	</td>
   </tr>

   <tr>
	<td class="TableData" >新密码：</td>
	<td class="TableData" >
	  <input type="password" name="pass1" id="pass1"  class="BigInput" size="20" maxlength="20" > 6-20位，必须同时包含字母和数字</td>
  </tr>

  <tr>
	<td class="TableData" >确认新密码：</td>
	<td class="TableData" >
	  <input type="password" name="pass2" id="pass2"  class="BigInput" size="20" maxlength="20" > 6-20位，必须同时包含字母和数字
	   <div id="style2"></div>
	  </td>
  </tr>

  <tr>
	<td class="TableData" >密码过期：</td>
	<td class="TableData" >
	  密码永不过期	</td>
  </tr>

  <tr align="center" >
    <td class="TableControl" colspan="2" >
      <input type="submit" value="保存修改" class='BigButton'>
    </td>
  </tr>

 </table>
</form>
    
  </body>
</html>
